////
//
/// \file ./include/inc/parser/name_node.hpp
//
//  Copyright 2007, 2008 Chandler Carruth
//
//  Licensed under the Apache License, Version 2.0 (the "License"); you may not
//  use this file except in compliance with the License.  You may obtain a copy
//  of the License at
//
//    http://www.apache.org/licenses/LICENSE-2.0
//
//  Unless required by applicable law or agreed to in writing, software
//  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
//  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
//  License for the specific language governing permissions and limitations
//  under the License.
//
////

#ifndef inc_parser_name_node_header
#define inc_parser_name_node_header

#include <string>

#include <boost/scoped_ptr.hpp>

#include <inc/parser/parse_tree_node.hpp>

namespace inc {
namespace parser {

class CompoundNameNode;
class LabelNode;

/// \brief  Internal parsing node for names
/// \author Chandler Carruth
/// \date   2007.07.26
///
/// This provides the name parse node. This node is the entry point from 
/// expressions, function calls, and other name resolving grammar points.

class NameNode : public ParseTreeNode
{
public:
  virtual bool parse( const iterator& first,
                      const iterator& last,
                      iterator& last_parsed );

  virtual LabelNode* get_label() const;
  virtual bool is_label() const { return get_label() != NULL; }

  virtual CompoundNameNode* get_compound_name() const;
  virtual bool is_compound_name() const { return get_compound_name() != NULL; }

private:
  /// Private pointer to hold the internal node used
  boost::scoped_ptr<ParseTreeNode> node_ptr;
};

} //  end parser namespace
} //  end inc namespace
#endif  //  inc_parser_name_node_header
